package com.fhz.day012;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

/**
 * 广播接收者
 * 1.广播发送者 sendbroadcase()
 * 2.右边-> other. broadcase()
 * 3,inent的属性,1是action,2是bundle
 * 4.清单文件中,加action
 *
 */
public class MyReceiver extends BroadcastReceiver {

    private static final String TAG = "feng";
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, "onReceive: ");
        String action = intent.getAction();
        Log.i(TAG, "onReceive: action"+action);
        Bundle extras = intent.getExtras();
        String name = extras.getString("name");
        Log.i(TAG, "onReceive: name"+name);
    }
}